package com.jpa.lgt.service.impl;

import com.jpa.lgt.service.BaseService;
import com.jpa.lgt.util.EntityManagerUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;
import java.util.Map;

/**
 * @author lgt
 * @time 2018/9/19
 * @description：
 */
@Service
public class BaseServiceImpl implements BaseService {

    @PersistenceContext
    @Autowired
    private EntityManager entityManager;

    @Override
    public List sqlRelativesVO(String sql, Map<String, Object> params, Class<?> clazz) {
        return EntityManagerUtil.findRelatives(sql,params,entityManager,clazz);
    }
}
